<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${namespace}">

    <!-- 结果 -->
    <resultMap id="${entityNameResultMap}" type="${entityClass}.${EntityName}">
        ${resultMap}
    </resultMap>

    <!-- 字段 -->
    <sql id="Base_Column_List">
        ${baseColumnList}
    </sql>

    <!-- 条件 -->
    <sql id="Where_Clause">
        ${whereClause}
    </sql>

    <!-- 新增数据 -->
    <insert id="insert" parameterType="${entityClass}.${EntityName}">
        ${insert}
    </insert>

    <!-- 批量插入数据 -->
    <insert id="batchInsert" parameterType="java.util.List">
        ${batchInsert}
    </insert>

    <!-- 根据主键删除数据 -->
    <delete id="deleteById" parameterType="Long">
        ${deleteById}
    </delete>

    <!-- 根据传入参数删除数据 -->
    <delete id="deleteByWhere" parameterType="${entityClass}.${EntityName}">
        ${deleteByWhere}
    </delete>

    <!-- 根据主键更新数据 -->
    <update id="updateById" parameterType="${entityClass}.${EntityName}">
        ${updateById}
    </update>

    <!-- 根据主键查询数据  -->
    <select id="queryById" resultMap="${entityNameResultMap}" parameterType="Long">
        ${queryById}
    </select>

    <!-- 根据主键批量查找数据列表  -->
    <select id="queryListByIdList" resultMap="${entityNameResultMap}" parameterType="java.util.List">
        ${queryListByIdList}
    </select>

    <!-- 根据传入参数查询数据列表  -->
    <select id="queryListByWhere" resultMap="${entityNameResultMap}" parameterType="${entityClass}.${EntityName}">
        ${queryListByWhere}
    </select>

    <!-- 根据条件查询一条记录  -->
    <select id="queryOne" resultMap="${entityNameResultMap}" parameterType="${entityClass}.${EntityName}">
        ${queryOne}
    </select>

    <!-- 统计符合条件的数据数量 -->
    <select id="countByWhere" resultType="integer" parameterType="${entityClass}.${EntityName}">
        ${countByWhere}
    </select>

</mapper>